<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .cls {
      width: 300px;
      height: 200px;
      border: 1px solid red;
    }
  </style>
</head>

<body>
  <div id="app">
    <input type="text" v-model.number="age"><br>
    <input type="text" v-model.trim="info"><br>
    <input type="button" value="按钮" @click="change"><br>
    <input type="text" v-model.lazy="msg">
    <div class="cls">
      {{msg}}
    </div>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    /* 
      表单修饰符:
        number: 转为数值
        trim: 出除首尾的空格
        lazy: 将input事件切为change事件(失去焦点后触发的事件)
    */
    const vm = new Vue({
      "el": "#app",
      "data": {
        "age": "",
        "info": "",
        "msg": ""
      },
      "methods": {
        change() {
          // console.log(this.age + 10);
          console.log(this.info.length);
        }
      }
    });
  </script>
</body>

</html>